package com.xiangyang.controller;
import com.xiangyang.entity.CaseHistory;
import com.xiangyang.entity.dto.Result;
import com.xiangyang.service.IRegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/CaseHistory")
@CrossOrigin
public class CaseHistoryController {
    @Autowired
    private IRegistrationService registrationService;
    @GetMapping("/addCaseHistory")
    public Result addPatients(Long PatientId,String symptom,String Diagnosis){
        return registrationService.addCaseHistory(PatientId, symptom,Diagnosis);
    }//新增病例
    @GetMapping("/updateCaseHistory")
    public Result updateCaseHistory(Long caseHistoryId,String symptom,String Diagnosis){
        return registrationService.updateCaseHistory(caseHistoryId, symptom,Diagnosis);
    }
    @GetMapping("/getCaseHistory")
    public Result getCaseHistory(String PatientName, String PatientPhone){
        return registrationService.getPrescriptionByRegistrationId(PatientName,PatientPhone);
    }//获取某个病例列表
    @GetMapping("/getallCaseHistory")
    public Result getallCaseHistory(){
        return registrationService.getallPrescription();
    }//获取病例列表
}
